<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\common\model;

/**
 * 平台标签模型
 */
class ExchangeTags extends ModelBase
{
    protected $insert = ['create_time'];


    public function getImagesAttr(){
        if($this->img_ids){
            $img_arr=explode(',',$this->img_ids);
            $arr=[];
            foreach ($img_arr as $k=>$v){
                $arr[]= get_picture_url($v,false);
            }
            return $arr;
        }else{
            return [];
        }

    }



    /**
     * 时间自动完成
     */
    public function setCreateTimeAttr()
    {

        return TIME_NOW;
    }
  
  public function  getNameAttr($value){

      $lang=isset($_REQUEST['lang'])?$_REQUEST['lang']:'';
      return   baidu_translate($value,$lang);

    }




}
